1. Technical Field
The present invention relates generally to websites and more specifically to managing a website. Even more specifically, the present invention relates to throttling all but a given number of requests directed to a website at the time the website is started up.
2. Description of Related Art
The Internet has become a cultural fixture as a source of both information and entertainment. Many businesses are creating Internet sites as an integral part of their marketing efforts, informing consumers of the products or services offered by the business or providing other information in order to engender brand loyalty. Many federal, state, and local government agencies are also employing Internet sites for informational purposes, particularly agencies that must interact with virtually all segments of society such as the Internal Revenue Service and secretaries of state. Providing informational guides and/or searchable databases of online public records may reduce operating costs. Further, the Internet is becoming increasingly popular as a medium for commercial transactions.
An inherent problem with many websites is that they fail under heavy use, often because of memory allocation problems in the Java Virtual Machine (JVM) on which the application executes. There are several common solutions to this problem, including caching commonly used objects to reduce CPU and memory overhead and using object pooling of expensive objects such as database connections. However, the use of these solutions causes a different problem when the JVM is coming up. Creating and placing objects into caches and pools is a highly memory-intensive and CPU-intensive operation, while taking the objects out of the caches and pools is not. When a JVM is starting up, its caches and pools are empty, so that the system is utilizing large amounts of memory and CPU time at start-up to fill the caches. If the JVM crashed because of a heavy load which does not abate, the application running on the JVM can experience a heavy request load at the same time it is experiencing heavy memory and CPU usage filling the caches, which can cause the JVM to crash again.
Thus, it is desirable to protect the JVM from high loads while the caches are being populated, and then allow the load to ramp up over time as the cache and pools are filled. This spreads out the CPU load and heap utilization from a spike into a plateau and improves system stability as a result.
Existing implementations of load management on the JVM are generally performed upstream of the servlet engine—they perform weighting and throttling at the router level before the request ever arrives at the servlet engine. However, this is complicated to put in place and requires that one adds additional layers of software and hardware to accomplish this throttling in a network. It would be desirable to provide protection to the JVM without requiring an additional layer of hardware and software.